package com.news;

import com.news.model.News;
import com.news.model.NewsDetail;
import com.news.model.NewsList;
import com.news.other.NewsContent;

import android.app.Application;

public class ScreenController extends Application {
	
	private NewsList newsList;
	private int current;
	
	public void onCreate(){
		super.onCreate();
		newsList = new NewsList();
		fillNews();
		//oneNew();
		current = 0;
	}
	
	private void oneNew() {
    	NewsDetail item1 = new NewsDetail();
    	item1.setTitle(NewsContent.title1);
    	item1.setImage(NewsContent.image1);
    	item1.setDetail(NewsContent.new1);
    	News news = new News(item1.getTitle(), item1.getImage(), item1);
    	newsList.addNew(news);
		
	}

	public void setCurrent(int i){
		current = i;
	}
	
	public int getCurrent(){
		return current;
	}

	
	private void fillNews(){
	    	
	    	NewsDetail item1 = new NewsDetail();
	    	item1.setTitle(NewsContent.title1);
	    	item1.setImage(NewsContent.image1);
	    	  	item1.setDetail(NewsContent.new1);
	        	News news1 = new News(item1.getTitle(), item1.getImage(), item1);
	        	newsList.addNew(news1);
	    	
	    	
	    	NewsDetail item2 = new NewsDetail();
	    	item2.setTitle(NewsContent.title2);
	    	item2.setImage(NewsContent.image2);
	    	item2.setDetail(NewsContent.new2);
	    	News news2 = new News(item2.getTitle(), item2.getImage(), item2);
	    	newsList.addNew(news2);
	    	
	    	NewsDetail item3 = new NewsDetail();
	    	item3.setTitle(NewsContent.title3);
	    	item3.setImage(NewsContent.image3);
	       	item3.setDetail(NewsContent.new3);
	       	News news3 = new News(item3.getTitle(), item3.getImage(), item3);
	       	newsList.addNew(news3);

	    	
	    	
	    }
	
	public NewsList getNews(){
		return newsList;
	}
	
	public void nextNews(){
		current++;
	}
	
	public void prevNews(){
		current--;
	}
	

	
	

}
